package com.clinic.domain;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;

@Entity
@PrimaryKeyJoinColumn(name = "cc_obj_id")
public class Clinic extends Super_type {

	private static final long serialVersionUID = 1L;

	@Column(insertable = false, updatable = false)
	private int cc_obj_id;
	@Column(length = 256)
	private String name;
	@Column(length = 256)
	private String address;
	@Column(length = 16)
	private String country_code;
	@Column(length = 128)
	private String city_name_en;
	@Column(length = 1024)
	private String workdays;
	@Column(length = 32)
	private String mobile_phone;
	@Column(length = 32)
	private String mobile_phone2;
	@Column(length = 32)
	private String home_phone;
	@Column(length = 128)
	private String owner_doctor;
	@Column(length = 128)
	private String admin_user;
	@Column(length = 128)
	private String specialty;
	@Column(length = 128)
	private String email;
	@Column(length = 512)
	private String site_url;
	@Column(length = 32)
	private String status;
	@Column(nullable = true)
	private boolean is_center;
	@OneToMany(mappedBy = "clinic", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private List<Clinic_leaves> clinic_leaves;
	@OneToOne(mappedBy = "clinic", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
	private Clinic_config clinic_config;

	public Clinic() {
		super();
	}

	public Clinic(String obj_owner_name, String name, String address,
			String country_code, String city_name_en, String workdays,
			String mobile_phone, String mobile_phone2, String home_phone,
			String owner_doctor, String admin_user, String specialty,
			String email, String site_url, String status, boolean is_center) {
		super(obj_owner_name);
		this.name = name;
		this.address = address;
		this.country_code = country_code;
		this.city_name_en = city_name_en;
		this.workdays = workdays;
		this.mobile_phone = mobile_phone;
		this.mobile_phone2 = mobile_phone2;
		this.home_phone = home_phone;
		this.owner_doctor = owner_doctor;
		this.admin_user = admin_user;
		this.specialty = specialty;
		this.email = email;
		this.site_url = site_url;
		this.status = status;
		this.is_center = is_center;
	}

	public Clinic(String obj_owner_name, String name, String address,
			String country_code, String city_name_en, String workdays,
			String mobile_phone, String mobile_phone2, String home_phone,
			String owner_doctor, String admin_user, String specialty,
			String email, String site_url, String status, boolean is_center,
			Clinic_config clinic_config) {
		super(obj_owner_name);
		this.name = name;
		this.address = address;
		this.country_code = country_code;
		this.city_name_en = city_name_en;
		this.workdays = workdays;
		this.mobile_phone = mobile_phone;
		this.mobile_phone2 = mobile_phone2;
		this.home_phone = home_phone;
		this.owner_doctor = owner_doctor;
		this.admin_user = admin_user;
		this.specialty = specialty;
		this.email = email;
		this.site_url = site_url;
		this.status = status;
		this.is_center = is_center;
		this.clinic_config = clinic_config;
	}

	public Clinic(String obj_owner_name, String name, String address,
			String country_code, String city_name_en, String workdays,
			String mobile_phone, String mobile_phone2, String home_phone,
			String owner_doctor, String admin_user, String specialty,
			String email, String site_url, String status, boolean is_center,
			List<Clinic_leaves> clinic_leaves) {
		super(obj_owner_name);
		this.name = name;
		this.address = address;
		this.country_code = country_code;
		this.city_name_en = city_name_en;
		this.workdays = workdays;
		this.mobile_phone = mobile_phone;
		this.mobile_phone2 = mobile_phone2;
		this.home_phone = home_phone;
		this.owner_doctor = owner_doctor;
		this.admin_user = admin_user;
		this.specialty = specialty;
		this.email = email;
		this.site_url = site_url;
		this.status = status;
		this.is_center = is_center;
		this.clinic_leaves = clinic_leaves;
	}

	public Clinic(String obj_owner_name, String name, String address,
			String country_code, String city_name_en, String workdays,
			String mobile_phone, String mobile_phone2, String home_phone,
			String owner_doctor, String admin_user, String specialty,
			String email, String site_url, String status, boolean is_center,
			List<Clinic_leaves> clinic_leaves, Clinic_config clinic_config) {
		super(obj_owner_name);
		this.name = name;
		this.address = address;
		this.country_code = country_code;
		this.city_name_en = city_name_en;
		this.workdays = workdays;
		this.mobile_phone = mobile_phone;
		this.mobile_phone2 = mobile_phone2;
		this.home_phone = home_phone;
		this.owner_doctor = owner_doctor;
		this.admin_user = admin_user;
		this.specialty = specialty;
		this.email = email;
		this.site_url = site_url;
		this.status = status;
		this.is_center = is_center;
		this.clinic_leaves = clinic_leaves;
		this.clinic_config = clinic_config;
	}

	public int getCc_obj_id() {
		return cc_obj_id;
	}

	public String getName() {
		return name;
	}

	public Clinic_config getClinic_config() {
		return clinic_config;
	}

	public void setClinic_config(Clinic_config clinic_config) {
		this.clinic_config = clinic_config;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getWorkdays() {
		return workdays;
	}

	public void setWorkdays(String workdays) {
		this.workdays = workdays;
	}

	public String getMobile_phone() {
		return mobile_phone;
	}

	public void setMobile_phone(String mobile_phone) {
		this.mobile_phone = mobile_phone;
	}

	public String getMobile_phone2() {
		return mobile_phone2;
	}

	public void setMobile_phone2(String mobile_phone2) {
		this.mobile_phone2 = mobile_phone2;
	}

	public String getHome_phone() {
		return home_phone;
	}

	public void setHome_phone(String home_phone) {
		this.home_phone = home_phone;
	}

	public String getOwner_doctor() {
		return owner_doctor;
	}

	public void setOwner_doctor(String owner_doctor) {
		this.owner_doctor = owner_doctor;
	}

	public String getAdmin_user() {
		return admin_user;
	}

	public void setAdmin_user(String admin_user) {
		this.admin_user = admin_user;
	}

	public String getSpecialty() {
		return specialty;
	}

	public void setSpeciality(String speciality) {
		this.specialty = speciality;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getSite_url() {
		return site_url;
	}

	public void setSite_url(String site_url) {
		this.site_url = site_url;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public List<Clinic_leaves> getClinic_leaves() {
		return clinic_leaves;
	}

	public void setClinic_leaves(List<Clinic_leaves> clinic_leaves) {
		this.clinic_leaves = clinic_leaves;
	}

	public String getCity_name_en() {
		return city_name_en;
	}

	public void setCity_name_en(String city_name_en) {
		this.city_name_en = city_name_en;
	}

	public String getCountry_code() {
		return country_code;
	}

	public void setCountry_code(String country_code) {
		this.country_code = country_code;
	}

	public boolean isIs_center() {
		return is_center;
	}

	public void setIs_center(boolean is_center) {
		this.is_center = is_center;
	}

	public void setSpecialty(String specialty) {
		this.specialty = specialty;
	}

	@Override
	public void _toString() {
		System.out.println("Enter - _toString");
		super._toString();
		System.out.println("address: " + this.address + "\ncountry_code: "
				+ this.country_code + "\ncity_name_en: " + this.city_name_en
				+ "\nadmin user: " + this.admin_user + "\nemail: " + this.email
				+ "\nhome phone: " + this.home_phone + "\nmobile phone: "
				+ this.mobile_phone + "\nmobile phone2: " + this.mobile_phone2
				+ "\nname: " + this.name + "\nowner doctor: "
				+ this.owner_doctor + "\nsire URL: " + this.site_url
				+ "\nspeciality: " + this.specialty + "\nstatus: "
				+ this.status + "\nworkdays: " + this.workdays
				+ "\nis_center: " + this.is_center + "\nclinic_leaves: "
				+ this.clinic_leaves + "\nclinic_config ID: "
				+ this.clinic_config.getCg_obj_id());
		System.out.println("Exit - _toString");
	}
}